import {Navigate, Route} from 'react-router-dom';
import Dashboard from '@pages/front/dashboard';
import ArticleList from '@pages/front/articleList';
import ArchiveList from '@/pages/front/archiveList';
import ArticleDetails from '@pages/front/articleDetails.tsx';

const frontRoutes = [
    <Route path="/dashboard" element={<Dashboard/>}>
        <Route index element={<ArticleList/>}/>
        <Route path="articles" element={<ArticleList/>}/>
        <Route path="articles/:articleId" element={<ArticleDetails />} />
        {/* <Route path="knowledge" element={<KnowledgeBase />} /> */}
         <Route path="archive" element={<ArchiveList />} />
        {/* 兜底重定向 */}
        <Route path="*" element={<Navigate to="articles" replace/>}/>
    </Route>
];

export default frontRoutes;
